<html>
<head><meta charset="utf-8"><title>vim configuration for rustc dev · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html">vim configuration for rustc dev</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="197414101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414101">(May 13 2020 at 13:43)</a>:</h4>
<p>I wanted to try out vim+RLS in Rustc itself</p>



<a name="197414199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414199">(May 13 2020 at 13:44)</a>:</h4>
<p>I'm using coc and coc-rust-analyzer</p>



<a name="197414240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414240">(May 13 2020 at 13:44)</a>:</h4>
<p>have placed this ...</p>



<a name="197414250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414250">(May 13 2020 at 13:44)</a>:</h4>
<div class="codehilite"><pre><span></span><code>{
    &quot;rust-analyzer.checkOnSave.overrideCommand&quot;: [
        &quot;./x.py&quot;,
        &quot;check&quot;,
        &quot;--stage 1&quot;,
        &quot;--json-output&quot;
    ]
}
</code></pre></div>



<a name="197414290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414290">(May 13 2020 at 13:44)</a>:</h4>
<p>in .vim directory on the workspace</p>



<a name="197414358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414358">(May 13 2020 at 13:45)</a>:</h4>
<p>but doesn't seem to work</p>



<a name="197414372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414372">(May 13 2020 at 13:45)</a>:</h4>
<p>was someone able to make it work</p>



<a name="197414526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414526">(May 13 2020 at 13:46)</a>:</h4>
<p><code>"--stage", "1"</code> rather than <code>"--stage 1"</code>?</p>



<a name="197414556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414556">(May 13 2020 at 13:46)</a>:</h4>
<p>yeah, was wondering about that</p>



<a name="197414577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414577">(May 13 2020 at 13:46)</a>:</h4>
<p>I'm also wondering if this is not related to the fact that I've placed .vim inside rustc dir</p>



<a name="197414611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414611">(May 13 2020 at 13:47)</a>:</h4>
<p>but I'm actually working in <code>librustc_mir</code></p>



<a name="197414640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414640">(May 13 2020 at 13:47)</a>:</h4>
<p>so probably the workspace config that vim is looking for should be in <code>librustc_mir</code></p>



<a name="197414700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414700">(May 13 2020 at 13:47)</a>:</h4>
<p>trying those things out</p>



<a name="197414820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414820">(May 13 2020 at 13:48)</a>:</h4>
<p>Can you see the log from the LSP? Might be a good way to figure out what's wrong</p>



<a name="197414962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414962">(May 13 2020 at 13:49)</a>:</h4>
<p>yeah have done zero investigation to be honest</p>



<a name="197414978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197414978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197414978">(May 13 2020 at 13:49)</a>:</h4>
<p>where is the log file typically located?</p>



<a name="197415224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197415224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197415224">(May 13 2020 at 13:51)</a>:</h4>
<p>Logging protocol requests is a client-side thing</p>



<a name="197415359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197415359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197415359">(May 13 2020 at 13:52)</a>:</h4>
<p>So, I don't know how is it set up in coc-vim unfortunately. In VS Code, you enable <code>"rust-analyzer.trace.server": "verbose",</code> setting and then see the log in the UI</p>



<a name="197415527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197415527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197415527">(May 13 2020 at 13:53)</a>:</h4>
<p>let me try setting that to verbose and seeing what happens</p>



<a name="197415998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197415998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197415998">(May 13 2020 at 13:56)</a>:</h4>
<p>ok both things were wrong :)</p>



<a name="197416128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197416128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197416128">(May 13 2020 at 13:57)</a>:</h4>
<p>I meant, it needed <code>"--stage", "1"</code> and also the problem is related to what I'm saying, I'd need to place the config on each crate or find a better way to set up this on all subdirectories under rustc main dir</p>



<a name="197416154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197416154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197416154">(May 13 2020 at 13:58)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> if you got client-side logging working, could you add the instructions to do this here? <a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/readme.adoc#coc-rust-analyzer">https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/readme.adoc#coc-rust-analyzer</a></p>



<a name="197416254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197416254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197416254">(May 13 2020 at 13:58)</a>:</h4>
<p>didn't try the logging because I realized by testing about the problem</p>



<a name="197416293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197416293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197416293">(May 13 2020 at 13:58)</a>:</h4>
<p>but could try to enable logging</p>



<a name="197416299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197416299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197416299">(May 13 2020 at 13:58)</a>:</h4>
<p>let me check</p>



<a name="197416434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197416434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197416434">(May 13 2020 at 13:59)</a>:</h4>
<p>(in general, any improvements to the docs are welcome ;) )</p>



<a name="197416542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197416542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197416542">(May 13 2020 at 14:00)</a>:</h4>
<p>have enabled it and no idea where is storing logs</p>



<a name="197416547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197416547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197416547">(May 13 2020 at 14:00)</a>:</h4>
<p>searching</p>



<a name="197422974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197422974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197422974">(May 13 2020 at 14:46)</a>:</h4>
<p>btw, forgot to report back here, my problem seemed to be that in order to have the top level coc configuration and the workspace coc configuration merged you need to reload coc after starting vim and loading an rs file</p>



<a name="197423043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197423043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197423043">(May 13 2020 at 14:47)</a>:</h4>
<p>if someone has a better solution would be great to hear that</p>



<a name="197617007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197617007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197617007">(May 14 2020 at 20:57)</a>:</h4>
<p>btw created this <a href="https://github.com/neoclide/coc.nvim/issues/1926">https://github.com/neoclide/coc.nvim/issues/1926</a></p>



<a name="197819475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20configuration%20for%20rustc%20dev/near/197819475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20configuration.20for.20rustc.20dev.html#197819475">(May 16 2020 at 23:04)</a>:</h4>
<p>this issue was fixed <a href="https://github.com/neoclide/coc.nvim/commit/9704f8d076426177dcbd92067dc76bafa266f852">https://github.com/neoclide/coc.nvim/commit/9704f8d076426177dcbd92067dc76bafa266f852</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>